home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 13 / 013.d81 / dos #32 < prev    next >
Text File  |  2022-08-26  |  4KB  |  197 lines

  1. ======================================
  2.       DOS & Don'ts -- Part 32
  3.  
  4.       by James Gregory Weiler
  5. ======================================
  6.  
  7.  
  8.  This month, DOS & Don'ts covers with
  9.  
  10. depth and clarity the organization of
  11.  
  12. data on your 1541 floppy disk.  There
  13.  
  14. is a lot of information here, so get
  15.  
  16. out your emetics and prepare for an
  17.  
  18. overDOSe.  You may want to try
  19.  
  20. printing each article to help follow
  21.  
  22. along because the information is so
  23.  
  24. complex.
  25.  
  26. ======================================
  27.        Part A: What's where.
  28. ======================================
  29.  
  30.   Put simply, a Commodore 1541 stores
  31.  
  32. data in 35 concentric circles on your
  33.  
  34. disk.  These circles are called
  35.  
  36. "tracks".  They are numbered from one
  37.  
  38. (the track nearest the outside rim of
  39.  
  40. the disk) to 35 (the track nearest the
  41.  
  42. hub).
  43.  
  44.   Each track is split up into a number
  45.  
  46. of smaller parcels called "blocks".
  47.  
  48. The number of blocks in any given
  49.  
  50. track is related to the physical size
  51.  
  52. of the track.  Tracks near the outside
  53.  
  54. edge of the disk are physically longer
  55.  
  56. than those near the hub, so they
  57.  
  58. contain more blocks.  Each block holds
  59.  
  60. 256 bytes of data.  Some folks call
  61.  
  62. blocks "sectors".
  63.  
  64.   Tracks 1 through 17 each contain 21
  65.  
  66. blocks numbered 0 through 20.
  67.  
  68.   Tracks 18 through 24 each contain 19
  69.  
  70. blocks numbered 0 through 18.
  71.  
  72.   Tracks 25 through 30 each contain 18
  73.  
  74. blocks numbered 0 through 17.
  75.  
  76.   Tracks 31 through 35 each contain 17
  77.  
  78. blocks numbered 0 through 16.
  79.  
  80.   Track 18 is a special track known as
  81.  
  82. the directory track.  The directory
  83.  
  84. track can be thought of as a disk's
  85.  
  86. index.  It contains references to
  87.  
  88. every block and every file on the
  89.  
  90. disk.  Whenever you tell DOS to do
  91.  
  92. anything to a file, the directory
  93.  
  94. track is the first place DOS looks.
  95.  
  96.   The directory track is divided into
  97.  
  98. two parts:  the BLOCK AVAILABILITY MAP
  99.  
  100. and the DIRECTORY.
  101.  
  102.   The Block Availability Map (BAM for
  103.  
  104. short) is exactly what its name
  105.  
  106. implies:  a map telling DOS which
  107.  
  108. blocks on the disk have files in them
  109.  
  110. and which are available for use by
  111.  
  112. new files.  Every time you SAVE,
  113.  
  114. SCRATCH, or OPEN and WRITE a file,
  115.  
  116. DOS keeps track of what parts of the
  117.  
  118. disk it changes by updating the
  119.  
  120. BAM.  The BAM is kept on track 18,
  121.  
  122. block 0.
  123.  
  124.   The rest of the directory track is
  125.  
  126. made up of the directory itself.
  127.  
  128. The directory is the actual index to
  129.  
  130. the rest of the data on a disk.  It
  131.  
  132. contains the names of all the files on
  133.  
  134. the disk and the track and block
  135.  
  136. numbers where DOS can find each file.
  137.  
  138. The directory resides on track 18,
  139.  
  140. blocks 1 through 18.
  141.  
  142.   Map 1 is a chart of all the blocks
  143.  
  144. on a disk and what type of information
  145.  
  146. is stored in them.  Except for track
  147.  
  148. 18, the entire disk is used to store
  149.  
  150. files.
  151.  
  152. ======================================
  153. Map 1: What's where on a 1541 disk.
  154.  
  155.   Each vertical line of letters
  156.  
  157. represents one track.  Each letter
  158.  
  159. represents one block, starting with
  160.  
  161. block zero at the top of the map.
  162.  
  163.  
  164. Key: B = BAM = block availability map
  165.      D = directory
  166.      F = file storage areas
  167.  
  168. tracks--->  11111111112222222222333333
  169.    12345678901234567890123456789012345
  170.  
  171. 00 FFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFFFFF
  172. 01 FFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFFFF
  173. 02 FFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFFFF
  174. 03 FFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFFFF
  175. 04 FFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFFFF
  176. 05 FFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFFFF
  177. 06 FFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFFFF
  178. 07 FFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFFFF
  179. 08 FFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFFFF
  180. 09 FFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFFFF
  181. 10 FFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFFFF
  182. 11 FFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFFFF
  183. 12 FFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFFFF
  184. 13 FFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFFFF
  185. 14 FFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFFFF
  186. 15 FFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFFFF
  187. 16 FFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFFFF
  188. 17 FFFFFFFFFFFFFFFFFDFFFFFFFFFFFF
  189. 18 FFFFFFFFFFFFFFFFFDFFFFFF
  190. 19 FFFFFFFFFFFFFFFFF
  191. 20 FFFFFFFFFFFFFFFFF
  192.  
  193.    12345678911111111112222222222333333
  194. tracks--->  01234567890123456789012345
  195.  
  196. =======< continued in Part 33 >=======
  197.